﻿using AutoMapper;
using O.M.Production.Domain.DTO;
using O.M.Production.Domain.DTO.Produce_work_order;
using O.M.Production.Domain.DTO.quality_inspection_management;
using O.M.Production.Domain.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace O.M.Helper
{
    public class MappingProfile : Profile
    {
        public MappingProfile()
        {
            //把DTO转换成实体
            CreateMap<internal_product_DTO, internal_product>();//内部生产
            CreateMap<produce_material_DTO, produce_material>();
            CreateMap<produce_product_DTO, produce_product>();
            CreateMap<produce_work_order_DTO, produce_work_order>(); //生产工单
            CreateMap<working_procedure_DTO, working_procedure>();
            CreateMap<quality_inspection_management_DTO, quality_inspection_management>();
            CreateMap<quality_inspection_report_DTO, quality_inspection_report>();

            //把实体转成DTO
            CreateMap<internal_product, internal_product_DTO>();//内部生产
            CreateMap<produce_material, produce_material_DTO>();
            CreateMap<produce_product, produce_product_DTO>();
            CreateMap<produce_work_order,produce_work_order_DTO>(); //生产工单
            CreateMap<working_procedure,working_procedure_DTO>();
            CreateMap<quality_inspection_management, quality_inspection_management_DTO>();
            CreateMap<quality_inspection_report, quality_inspection_report_DTO>();
        }
    }
}
